package com.xpffly.springboot.config.db.hikari;

import com.zaxxer.hikari.HikariDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @Author: xpengfei
 * @Date: 2020/11/30 16:26
 * @Description：Hikari数据源初始化
 */
//@Component
public class HikariDataSourceConfig {
    @Bean(name = "misDataSource", initMethod = "getConnection", destroyMethod = "close")
    @ConfigurationProperties(prefix = "database.mis")
    public HikariDataSource misDataSource() throws Exception {
        return new HikariDataSource();
    }

    @Bean(name = "aomdbDatasource", initMethod = "getConnection", destroyMethod = "close")
    @ConfigurationProperties(prefix = "database.aomdb")
    public HikariDataSource aomdbDatasource() throws Exception {
        return new HikariDataSource();
    }
}
